<?php
/**
 * @version		$Id: bannerclient.php 16825 2010-05-05 12:10:37Z louis $
 * @copyright	Copyright (C) 2005 - 2010 Open Source Matters, Inc. All rights reserved.
 * @license		GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('JPATH_BASE') or die;

jimport('joomla.html.html');
jimport('joomla.form.formfield');
jimport('joomla.form.helper');
JFormHelper::loadFieldClass('list');

/**
 * Bannerclient Field class for the Joomla Framework.
 *
 * @package		Joomla.Framework
 * @subpackage	com_banners
 * @since		1.6
 */
class JFormFieldTarget extends JFormFieldList
{
	/**
	 * The form field type.
	 *
	 * @var		string
	 * @since	1.6
	 */
	protected $type = 'Target';

	/**
	 * Method to get the field options.
	 *
	 * @return	array	The field option objects.
	 * @since	1.6
	 */
	public function getOptions()
	{
		// Initialize variables.
		$options = array();
		
		require_once JPATH_COMPONENT.'/helpers/ajaxwhois.php';
		$version = AjaxWhoisHelper::version();

		//define options
		$options[] = JHtml::_('select.option', '',  JText::_('COM_AJAXWHOIS_NO_TARGET'));
		$options[] = JHtml::_('select.option', '1', JText::_('COM_AJAXWHOIS_SAMEWINDOW_TARGET'));
		$options[] = JHtml::_('select.option', '2', JText::_('COM_AJAXWHOIS_NEWWINDOW_TARGET'));
		$options[] = JHtml::_('select.option', '3', JText::_('COM_AJAXWHOIS_RESIZABLEWINDOW_TARGET'));
		switch (strlen($version[0])) {
			case "4":
				$options[] = JHtml::_('select.option', '4', JText::_('COM_AJAXWHOIS_WHMCS_TARGET'));
				break;
			case "5":
				$options[] = JHtml::_('select.option', '4', JText::_('COM_AJAXWHOIS_AWBS_TARGET'));
				break;
			case "6":
				$options[] = JHtml::_('select.option', '4', JText::_('COM_AJAXWHOIS_DIRECTI_TARGET'));
				break;
			case "7":
				$options[] = JHtml::_('select.option', '4', JText::_('COM_AJAXWHOIS_ENOM_TARGET'));
				break;
			case "8":
				$options[] = JHtml::_('select.option', '4', JText::_('COM_AJAXWHOIS_EPPDRS_TARGET'));
				break;
			case "10":
				$options[] = JHtml::_('select.option', '4', JText::_('COM_AJAXWHOIS_CUSTOM_TARGET'));
				break;
		}
		return $options;
	}
}
